home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20020314-20021006 / 000023_entfred@hotmail.com_Fri Apr 5 17:07:33 EST 2002.msg < prev    next >
Text File  |  2020-01-01  |  2KB  |  56 lines

  1. Article: 13294 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!phl-feed.news.verio.net!iad-feed.news.verio.net!iad-peer.news.verio.net!news.verio.net!nntp1.roc.gblx.net!nntp.gblx.net!nntp.gblx.net!news-out.visi.com!hermes.visi.com!hub1.meganetnews.com!hub1.nntpserver.com!cox.net!sn-xit-02!supernews.com!postnews1.google.com!not-for-mail
  3. From: entfred@hotmail.com (Entfred)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: How to get return code from external Unix box running simple shell script?
  6. Date: 5 Apr 2002 13:29:53 -0800
  7. Organization: http://groups.google.com/
  8. Lines: 38
  9. Message-ID: <d6e12cad.0204051329.574003a2@posting.google.com>
  10. NNTP-Posting-Host: 140.147.127.146
  11. Content-Type: text/plain; charset=ISO-8859-1
  12. Content-Transfer-Encoding: 8bit
  13. X-Trace: posting.google.com 1018042194 24786 127.0.0.1 (5 Apr 2002 21:29:54 GMT)
  14. X-Complaints-To: groups-abuse@google.com
  15. NNTP-Posting-Date: 5 Apr 2002 21:29:54 GMT
  16. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:13294
  17.  
  18. I saw an old post that Frank da Cruz said about using IF SUCCESS or
  19. IF FAILURE to test the success or failure reported by an external command.
  20.  
  21. What I want to do is something a little different:
  22.  
  23. 1. Kermit script (on a Windows 2000 PC) telnets to an external Sun
  24. Unix box.  The Kermit script is in a file called test.ksc:
  25.  
  26. set term type at386
  27.  
  28. set network tcp/ip
  29. set host test.machine.com
  30. output \13
  31. input 5 login:
  32. output testuser\13
  33. input 5 password:
  34. output testpassword\13
  35. input 5 $
  36. output testscript\13
  37. connect
  38. if fail (I am not sure what do do right here to get Unix return code)
  39. Exit
  40. End ;
  41.  
  42. 2. On the Unix box, a simple script is run:
  43. (call the script, testscript)
  44.  
  45. echo This is a test 
  46. date
  47. exit 9
  48.  
  49. 3. I would like the result code of 9 to be sent back to the kermit 
  50. script residing on the Windows 2000 PC.  
  51.  
  52. How would this be done?  Any tips to doing this would be
  53. appreciated!
  54.  
  55. -- Entfred
  56.